import axios from '@/libs/axios1'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }
let base = '/testplatform/testTwoRestart'

// 查询测试漏洞列表
export const getTestDiscoveredVulnerabilitiesPage = params => {
  return axios({
    url: `${base}/getTestDiscoveredVulnerabilitiesPage`,
    method: 'GET',
    params,
    headers: jsonHeaders
  })
}

export const getTestProjectIdByProduct = params => {
  return axios({
    url: `${base}/getTestProjectIdByProduct`,
    method: 'GET',
    params,
    headers: jsonHeaders
  })
}

export const finalResultSubmissionStandard = data => {
  return axios({
    url: `${base}/finalResultSubmissionStandard`,
    method: 'POST',
    data,
    headers: jsonHeaders
  })
}

// 查询可用的测试组
export const judgeIsNetworkTarget = testProjectId => {
  return axios({
    url: `${base}/getJudgeTestObjectNetworked/${testProjectId}`,
    method: 'GET',
    headers: jsonHeaders
  })
}

// 根据资产查询软件、固件、服务下的产品
export const getProductByAsset = params => {
  return axios({
    url: `${base}/getAssetQueryProduct`,
    method: 'GET',
    params,
    headers: jsonHeaders
  })
}

// 创建漏洞
export const saveCreateVulnerability = data => {
  return axios({
    url: `${base}/saveCreateVulnerability`,
    method: 'POST',
    data,
    headers: jsonHeaders
  })
}

// 修改漏洞
export const updCreateVulnerability = data => {
  return axios({
    url: `${base}/updCreateVulnerability`,
    method: 'PUT',
    data,
    headers: jsonHeaders
  })
}

// 漏洞验证
export const submitValidationResults = data => {
  return axios({
    url: `${base}/submitValidationResults`,
    method: 'POST',
    data,
    headers: jsonHeaders
  })
}

// 再次发起复测流程
export const initiateRetestAgain = data => {
  return axios({
    url: `${base}/initiateRetestAgain`,
    method: 'POST',
    data,
    headers: jsonHeaders
  })
}

